﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="EZVRequest.aspx.cs" Inherits="BEGDC.CC.Web.EZVisit.EZVRequest" %>

<%@ Register Src="Controls/EZVRequestBasicInfo.ascx" TagName="EZVRequestBasicInfo" TagPrefix="uc2" %>
<%@ Register Src="Controls/EZVRequestApplicant.ascx" TagName="EZVRequestApplicant" TagPrefix="uc3" %>
<%@ Register Src="Controls/EZVRequestContract.ascx" TagName="EZVRequestContract" TagPrefix="uc4" %>
<%@ Register Src="Controls/EZVRequestVisit.ascx" TagName="EZVRequestVisit" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestCustomer.ascx" TagName="EZVRequestCustomer" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestAltAttendee.ascx" TagName="EZVRequestAltAttendee" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestAttachment.ascx" TagName="EZVRequestAttachment" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestQuotAttch.ascx" TagName="EZVRequestQuotAttch" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestFeedback.ascx" TagName="EZVRequestFeedback" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVRequestAftAttachment.ascx" TagName="EZVRequestAftAttachment" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVisitRequestComment.ascx" TagName="EZVisitRequestComment" TagPrefix="uc5" %>
<%@ Register Src="Controls/EZVisitRequestUrgentComment.ascx" TagName="EZVisitRequestUrgentComment" TagPrefix="uc5" %>
<%@ Register Src="../Workflow/ActionPanel/DefaultWorkflowActionPanel.ascx" TagName="DefaultWorkflowActionPanel" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>EZVisit Application Form</title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/ezform.css" type="text/css" rel="stylesheet" />
    <link href="../css/footer.css" rel="stylesheet" type="text/css" />
    <link href="../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../JS/jquery-1.4.4.min.js"></script>

    <script src="../js/jquery-ui.min.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript" src="../Workflow/Common/Workflow.js"></script>

</head>
<body class="ev-request-body-bg">
    <div id="divMask" class="hidden">
    </div>
    <form id="Form1" runat="server" method="post">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:ValidationSummary ID="edt_vs" runat="server" ShowSummary="false" ShowMessageBox="true" ValidationGroup="ValidateSubmit" />
    <%-- WARNING: DO NOT remove the below TextBox for generating __doPostBack function. --%>
    <asp:TextBox ID="txtPostback" runat="server" AutoPostBack="true" />
    <table class="ev-request-body">
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td colspan="2">
                            <img src="../images/logo2.gif" alt="Logo" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h3 class="formfont">
                                <asp:Label ID="lbAppNo" runat="server" />
                                <asp:Label ID="lblReqNo" runat="server" />
                            </h3>
                        </td>
                        <td class="txt_align_rgt padding5">
                            <uc1:DefaultWorkflowActionPanel ID="DefaultWorkflowActionPanel1" runat="server" />
                        </td>
                    </tr>
                    <tr class="line-border">
                        <td colspan="2">
                        </td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td class="title_list1 ar linkimg" width="65%">
                            <img src="../images/icon_form2.gif" alt="form" />&nbsp;EZVisit Application Form<br />
                            EZVisit 申请表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
                        <td class="txt_align_rgt padding_rgt5">
                            <% if (false)
                               {%>
                            <a title="Export to Excel (以Excel形式导出本申请单)" class="linkimg" href="./Common/ExcelExport.aspx?ID=<%= this.Request.QueryString["ID"] %>"
                                target="_blank">
                                <img src="../images/Xls.gif" alt="Export to Excel (以Excel形式导出本申请单)" /></a>
                            <% } %>
                            <% if (this.ucBasicInfo.Visible || this.ucQuotAttch.Visible || this.ucContract.Visible && !this.ucApplicant.Editable)
                               {%>
                            <a title="Print" class="linkimg" href="EZVRequestPrint.aspx?ID=<%= this.Request.QueryString["ID"] %>" target="_blank">
                                <img src="../images/print.gif" alt="Print (打印申请单)" /></a>
                            <% } %>
                        </td>
                    </tr>
                </table>
                <div>
                    <asp:UpdatePanel ID="uplCATBranch" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <br />
                            <table class="ph" width="100%">
                                <tr>
                                    <td align="right" width="40%">
                                        <span class="Star">*</span><span class="Copy-content">CAT/Branch(总部/分公司)：</span>
                                    </td>
                                    <td width="20%">
                                        <asp:DropDownList ID="ddlCATBranch" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCATBranch_SelectedIndexChanged">
                                        </asp:DropDownList>
                                        <asp:Label ID="lblCATBranch" runat="server"></asp:Label>
                                    </td>
                                    <td align="right" width="15%" id="secAccount" runat="server">
                                        <span class="Star">*</span><span class="Copy-content">Customer(客户)：</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlAccount" runat="server">
                                        </asp:DropDownList>
                                        <asp:Label ID="lblAccount" runat="server"></asp:Label>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div class="tab-line">
                        <div class="tab-pos" id="ev-request-tabs">
                            <asp:Label ID="tabBasicInfo" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlBasicInfo.ClientID %>" onclick="return evRequestTab.activate(this.hash);">EZVisit Form</a></asp:Label>
                            <asp:Label ID="tabApplicant" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlApplicant.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Applicant Info.</a></asp:Label>
                            <asp:Label ID="tabContract" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlContract.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Contract Info.</a></asp:Label>
                            <asp:Label ID="tabVisit" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlVisit.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Visit Info.</a></asp:Label>
                            <asp:Label ID="tabCustomer" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlCustomer.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Customer Info.</a></asp:Label>
                            <asp:Label ID="tabAttendees" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlAttendees.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Escorts</a></asp:Label>
                            <asp:Label ID="tabQuotAttch" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlQuotAttch.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Quotation Attch.</a></asp:Label>
                            <asp:Label ID="tabAttch" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlAttch.ClientID %>" onclick="return evRequestTab.activate(this.hash);">App Attch.</a></asp:Label>
                            <asp:Label ID="tabFeedback" runat="server" Visible="false" CssClass="ev-request-tab-link"><a href="#<%= pnlFeedback.ClientID %>" onclick="return evRequestTab.activate(this.hash);">Post Trip</a></asp:Label>
                        </div>
                        <%-- Empty DIV for clearing float. Can be replaced by CSS ":after". --%>
                        <div class="cb">
                        </div>
                    </div>
                    <asp:Panel ID="pnlBasicInfo" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVisitRequestUrgentComment ID="ucUrgent" runat="server" Visible="false"  /> 
                        <uc5:EZVisitRequestComment ID="ucComment" runat="server" Visible="false" />
                        <uc2:EZVRequestBasicInfo ID="ucBasicInfo" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlApplicant" runat="server" Visible="false" CssClass="hidden">
                        <uc3:EZVRequestApplicant ID="ucApplicant" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlContract" runat="server" Visible="false" CssClass="hidden">
                        <uc4:EZVRequestContract ID="ucContract" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlVisit" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVRequestVisit ID="ucVisit" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlCustomer" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVRequestCustomer ID="ucCustomer" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlAttendees" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVRequestAltAttendee ID="ucAltAttendee" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlQuotAttch" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVisitRequestUrgentComment ID="ucUrgent2" runat="server" Visible="false"  /> 
                        <uc5:EZVRequestQuotAttch ID="ucQuotAttch" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlAttch" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVRequestAttachment ID="ucAttachment" runat="server" />
                    </asp:Panel>
                    <asp:Panel ID="pnlFeedback" runat="server" Visible="false" CssClass="hidden">
                        <uc5:EZVRequestFeedback ID="ucFeedback" runat="server" />
                        <uc5:EZVRequestAftAttachment ID="ucAftAttchment" runat="server" />
                    </asp:Panel>
                    <asp:HiddenField ID="hidSelectedTab" runat="server" />
                    <asp:HiddenField ID="hidAppKey" runat="server" />
                    <asp:HiddenField ID="hidEventTarget" runat="server" />
                    <asp:Button ID="btnReload" CssClass="hidden" OnClick="btnReload_Click" runat="server" />
                    <asp:Button ID="btnSave" CssClass="hidden" OnClick="btnSave_Click" runat="server" />
                </div>
                <div class="cb">
                    <asp:PlaceHolder ID="phWorkflow" runat="server"></asp:PlaceHolder>
                </div>
            </td>
        </tr>
        <tr>
            <td class="ar padding_top5 padding_btm20 tab-top-line">
                <asp:Label ID="lblAppNo" runat="server" CssClass="fl formfont bold" Visible="false" />
                <a class="btn" href="#Form1" title="Goto top" style="color: #fff;">Go back to top (返回页首)</a>
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="ev-header-section">
                    I Promise (我承诺)</h3>
                <div class="padding5 ev-request-footer">
                    <br />
                    1. I have reviewed Alcatel-Lucent's Guidelines for Travel, Lodging and Other Promotional Expenses in connection with the planning of
                    this trip.<br />
                    <br />
                    2. As the applicant, I hereby confirm that:<br />
                    <br />
                    <ul class="padding_lft20">
                        <li style="list-style: disc inside">all the attendees are from and chosen/recommended by the customer.</li>
                        <li style="list-style: disc inside">all the information in the application is accurate.</li>
                        <li style="list-style: disc inside">all the expenses are to be paid directly to the PDC approved travel agents.</li>
                        <li style="list-style: disc inside">no per diem/cash will be provided to the attendees.</li>
                        <li style="list-style: disc inside">the agenda attached to the application approved by the Legal Department will be strictly
                            followed.</li>
                    </ul>
                    <br />
                    1. 我已经阅读了上海贝尔股份有限公司关于差旅、住宿和其他有关此次行程费用的政策和指导方针。<br />
                    <br />
                    2. 我作为申请者确认以下信息：<br />
                    <br />
                    <ul class="padding_lft20">
                        <li style="list-style: disc inside">所有的与会者均是客户的员工并由客户指派或推荐。</li>
                        <li style="list-style: disc inside">所提交的申请内容都是准确的。 </li>
                        <li style="list-style: disc inside">所有的费用都将直接支付给采购部核准的旅行社。</li>
                        <li style="list-style: disc inside">不会向与会者提供出差津贴或现金。 </li>
                        <li style="list-style: disc inside">将严格按照法律部批准的日程安排客户会议。</li>
                    </ul>
                </div>
                <div class="footerbox">
                    &copy; COPYRIGHT 2011 ALCATEL-LUCENT
                </div>
            </td>
        </tr>
    </table>
    </form>
    <div class="ev-request-body ev-request-footer">
        <asp:Label runat="server" ID="lblFooter"></asp:Label>
    </div>

    <script type="text/javascript">
        function openPanel(opt) {
            var arg = 'dialogHeight:' + (opt.height || 350) + 'px;dialogWidth:' + (opt.width || 700) + 'px;center:Yes;scroll:no;resizable:yes;status:no;';
            var v = window.showModalDialog(opt.url + '&sn=<%= this.SessionKey %>', this, arg);

            if (v === 'reload') {
                reload(opt.target);
            }

            return false;
        }

        function reload(target) {
            $('#<%= hidEventTarget.ClientID %>').val(target);
            $('#<%= btnReload.ClientID %>').click();
        }

        function openContractPanel(contractId) {
            // Reload the Contract datagrid.
            return openPanel({
                url: 'Common/EZVRequestContract.aspx?ContractInfoId=' + contractId,
                target: 'ContractInfo',
                height: 480
            });
        }

        function openCustomerPanel(customerId) {
            // Reload the Customer datagrid.
            return openPanel({
                url: customerId === -1 ? 'Common/EZVRequestCustomerImport.aspx?type=customer' : 'Common/EZVRequestCustomer.aspx?CustomerId=' + customerId,
                width: customerId === -1 ? 600 : 780,
                height: customerId === -1 ? 350 : 450,
                target: 'Customer'
            });
        }

        function openAttendeePanel(attendeeId) {
            // Reload the Attendee datagrid.
            return openPanel({
                url: 'Common/EZVRequestAttendee.aspx?AttendeeId=' + attendeeId,
                width: 580,
                height: 300,
                target: 'AltAttendee'
            });
        }

        function openUploadPanel(type) {
            $('#<%= this.btnSave.ClientID %>').click();
            // Reload the Gifts datagrid.
            return openPanel({
                url: 'Common/EZVRequestUpload.aspx?attchType=' + type,
                width: 600,
                height: 300,
                target: type
            });
        }

        var currentTab = $('#<%= hidSelectedTab.ClientID %>');

        var evRequestTab = new function() {
            var me = this;
            this.containers = [];
            this.tabs = [];
            this.init = function() {
                $('#ev-request-tabs a').each(function(i) {
                    var h = this.hash;
                    var p = '#' + this.parentNode.id;
                    me.containers[i] = h;
                    me.tabs[i] = p;
                    me.containers[h] = h;
                    me.tabs[h] = p;
                });

                return me;
            };
            this.activate = function(selected) {
                if (selected && selected[0] !== '#' || currentTab.val() !== selected) {
                    for (var i = 0; i < me.containers.length; i++) {
                        var t = $(me.containers[i]); ;
                        if (!t.hasClass('hidden')) {
                            t.attr('class', 'hidden');
                            $(me.tabs[i]).attr('class', 'ev-request-tab-link');
                            break;
                        }
                    }
                }

                // Always show the 1st tab.
                selected = me.containers[selected] || me.containers[0];

                $(me.tabs[selected]).attr('class', 'ev-request-tab-active bold');
                $(selected).removeClass('hidden').find('.focus:first').focus();
                currentTab.val(selected);
                if ('<%= this.ucBasicInfo.Visible %>' === 'False') {
                    setCookie(selected);
                }

                return false;
            };

            function setCookie(value) {
                document.cookie = 'prevTab=' + escape(value);
            }
        };

        if (currentTab) {
            evRequestTab.init().activate(currentTab.val());
        }
    </script>

</body>
</html>